
<fieldset class="layui-elem-field layui-field-title" style="margin-top: 30px;">
  <legend>供应商期初数据导入</legend>
</fieldset>
<div class="layui-upload-drag" id="supplier_balance_import">
  <i class="layui-icon"></i>
  <p>点击上传，或将文件拖拽到此处</p>
  <div class="layui-hide" id="uploadDemoView">
    <hr>
    <span>上传成功</span>
  </div>
</div>
{include file="block/layui" /}

<script type="text/javascript">
layui.use(['upload','jquery'],function(){
    var $ = layui.jquery;
    var upload = layui.upload;
     upload.render({
       elem: '#supplier_balance_import'
       ,url: '{:url('supplier_balance_import')}' //改成您自己的上传接口
       ,accept: 'file'
       ,before: function(obj){ //obj参数包含的信息，跟 choose回调完全一致，可参见上文。
          layer.load(); //上传loading
        }
       ,done: function(res){
         layer.closeAll('loading'); //关闭loading
         layer.msg(res.msg);
         console.log(res)
       }
       ,error: function(index, upload){
          layer.closeAll('loading'); //关闭loading
        }
     });


})
</script>
